package com.dlg.currencytrading.counter.bean.res;

import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;

import java.util.Objects;

/**
 * 持仓信息
 */
@Setter
@Getter
@NoArgsConstructor
@ToString
public class PosiInfo {

    private int id;
    private long uid;
    private int code;
    private String name;
    private long cost;
    private long count;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        PosiInfo posiInfo = (PosiInfo) o;
        return uid == posiInfo.uid && code == posiInfo.code && cost == posiInfo.cost && count == posiInfo.count && name.equals(posiInfo.name);
    }

    @Override
    public int hashCode() {
        return Objects.hash(uid, code, name, cost, count);
    }
}
